package com.woniuxy.education.controller;

import com.woniuxy.education.utils.ResponseResult;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ExceptionHandler;

public class ExceptionCenter {
    @ExceptionHandler({Exception.class})
    public ResponseResult<String> handleException(Exception e){
        ResponseResult<String> result = new ResponseResult<>();
        if (e instanceof AuthorizationException){
            result.setCode(500);
            result.setMessage("你没有权限,hhhhh");
        }
        return  result;
    }
}
